package com.yangle.eurekaclientproducter;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

//@SpringBootApplication(scanBasePackages = {"com.yangle.feign","com.yangle.eurekaclientproducter"})
@SpringBootApplication
@EnableFeignClients(basePackages ="com.yangle.feign" )
//@EnableHystrix
public class EurekaClientConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(EurekaClientConsumerApplication.class, args);
    }

    @Bean(name = "restTemplate")
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

    @Bean(name = "restTemplate2")
    @LoadBalanced
    public RestTemplate getRestTemplate2() {
        return new RestTemplate();
    }
    @Bean(name = "restTemplate3")
    @LoadBalanced
    public RestTemplate getRestTemplate3() {
        return new RestTemplate();
    }
}
